package framework.filters;

import framework.pipes.PullPipe;

/**
 * 
 * @author Wetzel & Rusch
 * 
 * @param <T>
 *            Incoming data type
 */
public abstract class AbstractPullFilter<T> implements PullFilter<T> {
	private final PullPipe<T> m_pullPipe;
	protected T m_data;

	public AbstractPullFilter(PullPipe<T> pullPipe) {
		m_pullPipe = pullPipe;
	}

	@Override
	public T pull() {
		if (m_pullPipe != null) {
			m_data = m_pullPipe.pull();
		}
		doIt();
		return m_data;
	}
}
